package com.modules.tag;

import com.alibaba.druid.sql.visitor.functions.Right;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;

/**
 * Created by lewis on 2017/6/16.
 */
public class ColumnTag extends SimpleTagSupport {

    private static final long	serialVersionUID	= -6603256673775909358L;
    private String field;
    private String title;
    private int width = 120;
    private Boolean fixed = false;
    private Boolean checkbox =true;
    private Boolean space = false;
    private Boolean LAY_CHECKED = false;
    private Boolean sort = true;
    private Boolean edit = false;
    private String templet;
    private String align = "center";
    private String toolbar;

    public void doTag() throws JspException, IOException {
        Column c = new Column();
        c.setCheckbox(checkbox);
        c.setField(field);
        c.setTitle(title);
        c.setWidth(width);
        c.setFixed(fixed);
        c.setLAY_CHECKED(LAY_CHECKED);
        c.setSort(sort);
        c.setEdit(edit);
        c.setAlign(align);
        c.setTemplet(templet);
        c.setToolbar(toolbar);
        c.setSpace(space);
        TableTag parent = (TableTag) getParent();
        parent.addColumn(c);
    }



    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public Boolean getFixed() {
        return fixed;
    }

    public void setFixed(Boolean fixed) {
        this.fixed = fixed;
    }

    public Boolean getCheckbox() {
        return checkbox;
    }

    public void setCheckbox(Boolean checkbox) {
        this.checkbox = checkbox;
    }

    public Boolean getSpace() {
        return space;
    }

    public void setSpace(Boolean space) {
        this.space = space;
    }

    public Boolean getLAY_CHECKED() {
        return LAY_CHECKED;
    }

    public void setLAY_CHECKED(Boolean LAY_CHECKED) {
        this.LAY_CHECKED = LAY_CHECKED;
    }

    public Boolean getSort() {
        return sort;
    }

    public void setSort(Boolean sort) {
        this.sort = sort;
    }

    public Boolean getEdit() {
        return edit;
    }

    public void setEdit(Boolean edit) {
        this.edit = edit;
    }

    public String getTemplet() {
        return templet;
    }

    public void setTemplet(String templet) {
        this.templet = templet;
    }

    public String getAlign() {
        return align;
    }

    public void setAlign(String align) {
        this.align = align;
    }

    public String getToolbar() {
        return toolbar;
    }

    public void setToolbar(String toolbar) {
        this.toolbar = toolbar;
    }
}
